version: '3.9'
  

services:
  fnsa-news-manager:
    build: fnsa-news-manager
    container_name: fnsa-news-manager
    environment:
      - CONFIG_FILE_PATH=/app/config.yml
      - ETCD_HOST=fnsa-news-manager-etcd
      - ETCD_PORT=2379
      - PARSE_ONLY_NEW_ITEMS=false
      - CUT_OFF_SECONDS=1800
    volumes:
      - ./config.yml:/app/config.yml
    depends_on:
      - fnsa-news-manager-etcd


###########################################################
  fnsa-news-manager-etcd:
    image: quay.io/coreos/etcd:v3.5.14
    container_name: fnsa-news-manager-etcd
    environment:
      - ETCD_NAME=etcd
      - ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd:2380
      - ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
      - ETCD_INITIAL_CLUSTER=etcd=http://etcd:2380
      - ETCD_INITIAL_CLUSTER_STATE=new
      - ETCD_INITIAL_CLUSTER_TOKEN=etcd-cluster-1
      - ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
      - ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
      - ETCD_DATA_DIR=/etcd-data
    volumes:
      - etcd-data:/etcd-data

volumes:
  etcd-data: